#coding=utf-8
'''
# @Name:__init__.py
# @author:mysouil
# @Description:index蓝图模块
# @DATE:2022/9/27 21:19
# @Modified By:
'''

from flask import Blueprint
from flask_restful import Api
from comment.utils.output import output_json
from shopping.resources.index.index_resource import Shopping_Category,Shopping_HomeNewProduct,\
    Shopping_HomeRecommendProduct,Shopping_RecommendSubject


# 创建蓝图
index_bp = Blueprint('index',__name__,url_prefix='/index')

index_api = Api(index_bp)  # 创建蓝图中的资源api

# 使用自定义的json格式，替代装饰器的写法
index_api.representation('application/json')(output_json)

index_api.add_resource(Shopping_Category,'/category',endpoint='category')
index_api.add_resource(Shopping_HomeNewProduct,'/home_new_product')
index_api.add_resource(Shopping_HomeRecommendProduct,'/home_recommend_product')
index_api.add_resource(Shopping_RecommendSubject,'/recommend_subject')